use crate::config::ring::local_ring;
use tauri::command;

#[command]
pub(crate) async fn start_music() {
    local_ring();
}

#[command]
pub(crate) async fn stop_music() {
    let ring_wrap = &crate::config::ring::RING.read();

    match ring_wrap {
        Ok(ring) => {
            tracing::info!("stop ring now");
            ring.stop();
        }

        Err(e) => {
            tracing::error!("stop ring failed: {}", e);
        }
    }
}
